package com.wnm.web;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000119641263";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCfSbsASz0QhFw0A37ls1Vil3GPBu48Db/kWmpwhqfTshh+OU+yEnDW53dM2dWgNsvdWNr1mOR+ZOcfsPfhS2Xc6rhPCgF2me7wG3yTcva3/9VySVixlESxFMOV5/6YWxQcQaDOCr2TZ2+vIGnFB8lm7o263Ji0nlk5p+TX0jxaCZVNsekTYGn9YhCidLJvZBfGHs17G6hheQHk3zn7zpeKj5Ueo/Zot9Tk2MxN9xh7i8LQAEnJGAfEiRuVUITpEyqjBGqV6E5EKpCiilER/g/63Q/HKM1cx/sE/gdwsUjQA72thauYqpUPSEqQ2YSgmSlFdxBasazW0+2DOsJAeQaLAgMBAAECggEAMmWCe9pSLKqj/XTprkUqC7J8pFL+BxQWlWoh6Q5BhRIA+9aoJ1/8QZIkRbVaCIGtyI93X2MLUA4ergEwvCA9z0KYI7G3us2DMoaPyJsEAj04TBt2q2CMxzYZl5E6FPwkBbih5u6xAjUkudTYghUvnJh3URrAWc0Lz9kV507F93o26agY50LTe3IgF8WUmcmcaHr/YBhFaZLAbX+9lo6TK3tsFWFd88+ceazBul7h/0YkCJ49Upw/u7uzy9+kD1SVVKxy5nKw+dVd8wj2cQwUjEhSAZRRvip1S5MbYlyyBHE/HNVLDtEL+295z4EKbG03l+fT8jfUZZPxU4iFkAUwsQKBgQDOhOfbybxnmIkxTyAIGlfAhRvCQBGGRUoA1KjewGPSp9NsUn8Fjg3fLk8g1srvxWy7856HijOAMVmAtLQNSBjGnqsOMllzlAm/c+hlF2wLErMUDT6mDlKvlPIH0Ay7iZg0gzOZLr6ohQ50BW2j3SiROYvOQ+/MrpBgcwX6ttCZaQKBgQDFc9jGKy+M1FBtUj+PnD8eX6AqEgq+ihA8utLLgWTL/xZK41AMx3ux3eHqfd51miFn5KmwW5c5rrmhOoYSbUBpHOJC+0Yqn6duZQgB2zRUCsKHwkgLALk7BEibXrZzA0pEoVJCKvRMGBqJh1+n89RNXMgo1xchowsa5DS3bnZN0wKBgCmlY5xO8k9x0zi+XBdGOKv6K77gbKhHEMVaHTPOWFMCxP/zIupb2zBGhm544jO3/FVqq21p0TjousPZrPWAtH5ZQOV8Ac3s7IpPNW4tavxQqQxCH4AdI0+FGcm5itfGx4rPanhZlNkm++MptRJ2ZtfiYu8VhCYijbrldy837pkBAoGAY2x58w872kXuWZ3Ys4+RmNG97HE5R8htdKb+DcsR3kaMCxl67XRlLKL1ZwYKRl1eBNp3N35nH3yDrFOzvwOUM1l/9QphwoSx4jytU4H1T3w7h/CkJiYvHzCA/vsqE6/MbdJtgTPv34Ejm6y21fNJK8tUXnwwAZf/t4LBqLvOhlECgYB+iGc9X+AeizeoW2MhomR4/RI8YO9zCizqUpYmdblM9raGOdpiXCxUW9g+1j040tqHjU3aB1WAAzL/iO7OKQw7/AKoZ3c3LLpp43/U5oXzSafGdRxXhGqIzgZRYPVOOFd1RmvCAlAFhyxGtWaNBYxM9o19SnZ4n1RHEqfa6M6/KA==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkjj4QDxrna5H9hHAhFTBAFTbXK+Q2mecbW2fT+rhqaFrES8u0Vb7vm/OVDWQg8nXI/CTLdURAw6ipJ8rwMSopKFQ+DLyi/uIrpwqbWeSDRC65ugrxAu9BaO5rsHi+JMH5hg3Pfg2OOU7hjpkS/gaMfTcFAITkP9f1bWsePqYTSXsmVx4m64nHyrdlZzyf9sxiLSEVSysCJEtyI8Ad+fGJkYpC4VibV+a0gOwmLTuVmDNd7k1YIbHKcorhVC8/mui7FTluf3OdAi7l0I7Fs8KsP0zr2UmC0af89N20uYXCibxGqTxUt0p5I1q2/XzTtdjFCiHfsR6RLRpgATMps5JPwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/wnm/updateServlet";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/wnm/pages/personal.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

